Skip to content

Instantly share code, notes, and snippets.

@chuongmep
chuongmep / PurgeCAD.cs
Last active May 10, 2024 21:45
Purge CAD
public static void PurgesCAD()
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
using (Transaction Tx = db.TransactionManager.StartTransaction())
{
BlockTable table = Tx.GetObject(db.BlockTableId,
OpenMode.ForRead) as BlockTable;
ObjectIdCollection blockIds = new ObjectIdCollection();
do
@kennypete
kennypete / navigating_the_modes_of_Vim.md
Created April 18, 2024 20:46
Navigating the modes of Vim

Navigating the modes of Vim

This diagram illustrates navigating through Vim’s modes. It was built factoring Vim 9 (i.e., all its modes, including up to two new modes, cr and cvr, in November 2023). Information about the state() and 'showmode' is provided too.

SVG version

Some features are only available in the SVG version. It is not provided directly from within this gist’s files because SVGs do not always play nicely in GitHub (particularly, refusing to display embedded fonts).

The SVG version includes hover text help, which shows pertinent information about the underlying key, command, mode, etc.

@bearlikelion
bearlikelion / Log.gd
Last active May 10, 2024 21:44
Godot debug screen console autoload
extends Node
var debug: bool = OS.has_feature("debug")
@onready var panel: Panel = Panel.new()
@onready var canvas_layer: CanvasLayer = CanvasLayer.new()
@onready var rich_text_label: RichTextLabel = RichTextLabel.new()
# @onready var theme: Theme = load("res://SurvivalScape.theme") # Your custom theme file
func _ready() -> void:
@ertugrulturan
ertugrulturan / routeros.sh
Last active May 10, 2024 21:44
RouterOS Install Ubuntu 20.04/22.04 Server
#!/bin/bash
wget https://download.mikrotik.com/routeros/7.13.3/chr-7.13.3.img.zip -O chr.img.zip && \
gunzip -c chr.img.zip > chr.img && \
mount -o loop,offset=512 chr.img /mnt && \
ADDRESS=`ip addr show ens18 | grep global | cut -d ' ' -f 6 | head -n 1` && \
GATEWAY=`ip route list | grep default | cut -d ' ' -f 3` && \
echo "/ip address add address=$ADDRESS interface=[/interface ethernet find where name=ether1]
/ip route add gateway=$GATEWAY
/ip service disable telnet
/user set 0 name=root password=xxxxxx"
@unitycoder
unitycoder / FolderTypeFix.reg
Last active May 10, 2024 21:41
Make Windows Folder Browsing Faster (by disabling folder type detection)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell]
"FolderType"="NotSpecified"
@manwithsteelnerves
manwithsteelnerves / KeyboardHelper.java
Created December 9, 2017 05:38
Webview Adjust Pan in Fullscreen Activity
package com.voxelbusters.nativeplugins.helpers;
import android.app.Activity;
import android.graphics.Rect;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import com.voxelbusters.nativeplugins.helpers.interfaces.IKeyboardListener;
@rjescobar
rjescobar / extend-trial-jetbrains-windows.bat
Created August 31, 2021 02:53
JetBrains IDE trial reset windows
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 10, 2024 21:38
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@shamil
shamil / mount_qcow2.md
Last active May 10, 2024 21:37
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8